home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / gnu_st.lha / gnu_st / smalltalk-1.1.1 / config.mst < prev    next >
Text File  |  1991-09-12  |  4KB  |  184 lines

  1. #!/bin/sh
  2. # Configuration script for GNU Smalltalk
  3. #   Copyright (C) 1990 Free Software Foundation, Inc.
  4.  
  5. #This file is part of GNU Smalltalk.
  6.  
  7. #GNU Smalltalk is free software; you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation; either version 1, or (at your option)
  10. #any later version.
  11.  
  12. #GNU Smalltalk is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16.  
  17. #You should have received a copy of the GNU General Public License
  18. #along with GNU Smalltalk; see the file COPYING.  If not, write to
  19. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. #
  22. # Shell script to create proper links to machine-dependent files in
  23. # preparation for compiling Smalltalk.
  24. #
  25. # Usage: config.mst machine
  26. #
  27. # If config.mst succeeds, it leaves its status in config.status.
  28. # If config.mst fails after disturbing the status quo, 
  29. #     config.status is removed.
  30. #
  31.  
  32. progname=$0
  33. testing=    #Make this be a non-null string to enable testing
  34.  
  35. if [ $testing ]
  36. then
  37.     #for Test
  38.     remove="echo rm"
  39.     hard_link="echo ln"
  40.     symbolic_link="echo ln -s"
  41.     echo testing
  42. else
  43.     remove=rm
  44.     hard_link=ln
  45.     symbolic_link='ln -s'
  46. fi
  47.  
  48. for arg in $*;
  49. do
  50.   case $arg in
  51.    -srcdir=*)
  52.     srcdir=`echo $arg | sed s/-srcdir=//`
  53.     ;;
  54.    *)
  55.     machine=$arg
  56.     ;;
  57.   esac
  58. done
  59.  
  60. # Find the source files, if location was not specified.
  61. if [ x$srcdir = x ]
  62. then
  63.     srcdirdefaulted=1
  64.     srcdir=.
  65. fi
  66.  
  67. if [ x$machine != x ];
  68. then
  69.     case $machine in
  70.     vax)                    # for vaxen running bsd
  71.                 ;;
  72. #    vax-sysv | vaxv)            # for vaxen running system V
  73. #        cpu_type=vax
  74. #        configuration_file=xm-vaxv.h
  75. #        target_machine=tm-vaxv.h
  76. #        ;;
  77.     atari | atari-tos)
  78.         machine=atari
  79.         ;;
  80.     next)
  81.         ;;
  82.     sun-os4)
  83.         ;;
  84.     sun-os3)
  85.         ;;
  86.     hp9k3*)                # HP 9000 series 300 (hp-ux 6.5)
  87.         machine=hp9000_300
  88.         ;;
  89.     hp9k8*)                # HP 9000 series 800 (precision arch?)
  90.                     # hp-ux 7.0
  91.         machine=hp9000_800
  92.         ;;
  93.     news)
  94.         ;;
  95.     encore)
  96.         ;;
  97.     386 | i386 | i386-sysv)
  98.         shortnames=1
  99.         machine=i386-sysv
  100.         ;;
  101.     iris | sgi | iris4d)        # Mostly like a MIPS.
  102.         machine=iris4d
  103.         ;;
  104. #    mips)                # Default MIPS environment
  105. #        ;;
  106. #    mips-sysv)            # SYSV variant of MIPS system.
  107. #        cpu_type=mips
  108. #        target_machine=tm-mips-sysv.h
  109. #            ;;
  110. #    mips-bsd43)            # BSD 4.3 variant of MIPS system.
  111. #        cpu_type=mips
  112. #        target_machine=tm-mips-bsd.h
  113. #            ;;
  114.     ds3100 | dec-3100 | decstation)    # Decstation or pmax.
  115.         machine=ds3100
  116.             ;;
  117. ### apollo (Domain/OS 10.1 or later)
  118.     apollo | apollo-3000)
  119.         machine=apollo
  120.         ;;
  121.     apollo-88k)
  122.         ;;
  123.     pyr-bsd | pyramid)
  124.         machine=pyr-bsd
  125.         ;;
  126.     sequent)
  127.         ;;
  128.     tek4310)
  129.         ;;
  130.     esac
  131.  
  132.     # if cpu_type is not set, define cpu_type to machine.
  133.     #
  134.     configuration_file=${configuration_file-m-$machine.h}
  135.  
  136.     files="$configuration_file"
  137.     links="mstconfig.h"
  138.  
  139.     while [ -n "$files" ]
  140.     do
  141.         # set file to car of files, files to cdr of files
  142.         set $files; file=$1; shift; files=$*
  143.         set $links; link=$1; shift; links=$*
  144.  
  145.         if [ ! -r ${srcdir}/config/$file ]
  146.         then
  147.             echo "$progname: cannot create a link \`$link'," 1>&2
  148.             echo "since the file \`config/$file' does not exist." 1>&2
  149.             exit 1
  150.         fi
  151.  
  152.         $remove -f $link
  153.         rm -f config.status
  154.         # Make a symlink if possible, otherwise try a hard link
  155.         $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link
  156.  
  157.         if [ ! -r $link ]
  158.         then
  159.             echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
  160.             exit 1
  161.         fi
  162.         echo "Linked \`$link' to \`${srcdir}/config/$file'."
  163.     done
  164.     if [ $shortnames ]    #patch up truncated names
  165.     then
  166.         link-usg-names
  167.     fi
  168.  
  169.     echo "Links are now set up for use with a $machine." \
  170.         | tee config.status
  171.  
  172.     exit 0
  173. else
  174.     echo "Usage: $progname machine"
  175.     echo -n "Where \`machine' is something like "
  176.     echo "\`vax', \`sun3', \`umax', etc."
  177.     if [ -r config.status ]
  178.     then
  179.         cat config.status
  180.     fi
  181.     exit 1
  182. fi
  183.  
  184.